//
//  WorkHomeVC.m
//  XLDoctor
//
//  Created by longma on 2018/7/27.
//  Copyright © 2018年 XLH. All rights reserved.

#import "IBMMSimpleVC.h"
#import "DetectionItemViewController.h"
#import "MJMultipleDetectionResultVC.h"
#import "MemberDetectionRecordVC.h"
#import "EnterCodeController.h"
#import "MJGoutDetectionResultVC.h"
#import "MJBloodSugarDetectionResultVC.h"
#import "MJHemoglobinDetectionResultVC.h"
#import "MJTotalDetectionResultVC.h"
#import "NotesGuideAlertView.h"
#import "MemberSelectAlertView.h"
#import "AddMemberVC.h"
#import "PrinterSrarchView.h"
#import "EmailAddressController.h"
#import "SelectTestItemAlertView.h"
#import "SelectTestItemExportView.h"
#import "MemberSelectExportView.h"
#import "SelectDateExportView.h"
#import "AllCountryCodeVC.h"
#import "SearchAllCountryCodeVC.h"
#import "MemberInfoVC.h"

@interface IBMMSimpleVC ()
@property (weak, nonatomic) IBOutlet UIStackView *askStackView;
@property (weak, nonatomic) IBOutlet UIView *mView;
@property (weak, nonatomic) IBOutlet UILabel *tapLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *tapBgViewW;

@end

@implementation IBMMSimpleVC
#pragma mark - 系统
- (void)viewDidLoad {
    [super viewDidLoad];
    
    

//    //点我重试
    CGSize tapSize = [self.tapLabel sizeThatFits:CGSizeMake(MAXFLOAT, 25)];
    CGFloat normal_width = SCREEN_WIDTH*0.6;
    if(tapSize.width > normal_width){
        self.tapBgViewW.constant = normal_width;
    }else{
        self.tapBgViewW.constant = tapSize.width + 20;
    }

//    NSString *tapString = MJUILocalizedString(@"No meters found? Tap to retry.");
//    NSArray *lab = [status.labels componentsSeparatedByString:@","];

//    if([tapString containsString:@""]){
//        
//    }
//    self.tapLabel.text = tapString;
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
}

- (void)mj_setUI{
    [super mj_setUI];
    
    self.title = @"测试vc";
    
    self.view.backgroundColor = UIColor.mj_backgroundColor;
    [self setNavRightItemTitle:@"点击"];

    //
    [self handleRightBarButtonClick];
//    [self ocUI];

    MJWeakSelf
    MJUIAfter_GCD(2, ^{
        //        [weakSelf show8888];
    });
  
    
}
- (IBAction)handleNoUploadButtonClick:(UIButton *)sender {
    [WCBDHelper.shared mj_uploadLocalGoutArray];
}
- (IBAction)handleDeleteButtonClick:(UIButton *)sender {
    [WCBDHelper.shared removeFiles]; //删除所有文件表

}
- (IBAction)handleUploadButtonClick:(UIButton *)sender {
//    NSString *detectionId = [[NSDate new] mj_timestampStr];
    NSString *detectionId = @"2816667043317891070";
    NSString *createDateTime = [[NSDate new] mj_dateConvertToStringByFormat:MJUIDateFormat];
    NSLog(@"detectionId===============%@=======createDateTime=====%@",detectionId,createDateTime);

    //插入尿酸数据
    MJGoutDetectionModel *model = [[MJGoutDetectionModel alloc]init];
    model.period = @"Fasting";
    model.patientId = @"1815226802488954880";
    model.patientName = @"湖人";
    model.bloodUricAcid = 14.88;
    model.bloodUnit = @"mg/dL";
    model.userId = @"1813865009078251520";
    model.gender = @"Female";
    model.age = 35;
    model.detectionId = detectionId;
    model.createDateTime = createDateTime;

    [WCBDHelper.shared mj_insertGoutObjectWithModel:model];
}
- (void)ocUI{
    
#pragma mark - Label
     [self pushViewController:@"MJLabelController"];
#pragma mark - Button
//     [self pushViewController:@"MJUIButtonController"];
    
}

- (void)printUI {

    
    PrinterSrarchView *printerSrarchView = [[PrinterSrarchView alloc] init];
    printerSrarchView.modalPresentationStyle = UIModalPresentationOverCurrentContext;
    self.modalPresentationStyle = UIModalPresentationCurrentContext;
    [self.navigationController presentViewController:printerSrarchView animated:NO completion:nil];
}
//mjdebugg
- (void)handleRightBarButtonClick{
    
    NotesGuideAlertView *notesGuideAlertView = [[NotesGuideAlertView alloc] init];
    notesGuideAlertView.alertViewType = CenterAlertViewTypeTestStrip;
    notesGuideAlertView.modalPresentationStyle = UIModalPresentationOverCurrentContext;
    notesGuideAlertView.confirmBlock = ^{
        NSLog(@"MJLog======================确认");
    };
    notesGuideAlertView.cancelBlock = ^{
        NSLog(@"MJLog======================取消");

    };
    [[UIViewController mj_topViewController].navigationController presentViewController:notesGuideAlertView animated:NO completion:nil];
    
//    [RoyHud showToast:@"Не найдено измерителей?"];
    
    

//    MJUIAlertViewConfigure *configure = [[MJUIAlertViewConfigure alloc]init];
//    configure.confirmButtonColor = UIColor.mj_appColor;
//    configure.confirmTitle = MJUILocalizedString(@"OK_qd");
//    configure.cancelTitle = MJUILocalizedString(@"Cancel_qx");
//    configure.messageAlignmentCenter = true;
//    NSString *messageString = [[MJUILocalizedString(@"We will send a verification code to the following email address:") stringByAppendingString:@"\n"] stringByAppendingString:@"963641873@qq.com"];
//    [MJUIAlertView alertViewWithTitle:MJUILocalizedString(@"Email Address Confirmation") message:messageString configure:configure confirmBlock:^{
//        
//        
//    } cancelBlock:^{
//
//    }];
    
    //检测档案
//    MemberInfoVC *vc = [[MemberInfoVC alloc]initWithPatientId:@"1815226802488954880"];
//    [self.navigationController pushViewController:vc animated:true];
    //检测记录 选择成员
//    MemberSelectAlertView *memberSelectAlertView = [[MemberSelectAlertView alloc] init];
//    memberSelectAlertView.modalPresentationStyle = UIModalPresentationOverCurrentContext;
//    memberSelectAlertView.isDetectionRecord = true;
//    self.modalPresentationStyle = UIModalPresentationCurrentContext;
//    [self.navigationController presentViewController:memberSelectAlertView animated:NO completion:nil];
    
//    [self handleUploadButtonClick:nil];
    
    //搜索国家地区 区域码
//    SearchAllCountryCodeVC *vc = [[SearchAllCountryCodeVC alloc]init];
//    [self.navigationController pushViewController:vc animated:true];
    
//    AllCountryCodeVC *vc = [[AllCountryCodeVC alloc]init];
//    vc.handleCountryCodeBlock = ^(NSDictionary *countryAreaCode) {
//        NSString *code = [NSString stringWithFormat:@"+%@",countryAreaCode[@"区号"]];
////        weakSelf.countryCodeLabel.text = code;
////        weakSelf.countryAreaCode = countryAreaCode;
//
//    };
//    [self.navigationController pushViewController:vc animated:true];
    
    //表格导出
//    [self pushViewController:@"ExcelExportController"];
    
//    SelectTestItemExportView *selectTestItemAlertView = [[SelectTestItemExportView alloc] init];
//    selectTestItemAlertView.confirmBlock = ^(NSMutableArray *array) {
//        NSLog(@"MJLog=======================%@",array);
//    };
//    selectTestItemAlertView.modalPresentationStyle = UIModalPresentationOverCurrentContext;
//    self.modalPresentationStyle = UIModalPresentationCurrentContext;
//    [self.navigationController presentViewController:selectTestItemAlertView animated:NO completion:nil];
    
    //
//    MemberSelectExportView *selectTestItemAlertView = [[MemberSelectExportView alloc] init];
//    selectTestItemAlertView.confirmBlock = ^(NSArray *array) {
//        
//    };
//    selectTestItemAlertView.modalPresentationStyle = UIModalPresentationOverCurrentContext;
//    self.modalPresentationStyle = UIModalPresentationCurrentContext;
//    [self.navigationController presentViewController:selectTestItemAlertView animated:NO completion:nil];
    
    //
//    SelectDateExportView *selectDateExportView = [[SelectDateExportView alloc] init];
//    selectDateExportView.modalPresentationStyle = UIModalPresentationOverCurrentContext;
//    self.modalPresentationStyle = UIModalPresentationCurrentContext;
//    [self.navigationController presentViewController:selectDateExportView animated:NO completion:nil];
    
#pragma mark - 打印
//        [self printUI];
    //    [self jumpMemberSelectAlertView];
#pragma mark - 输入验证码
//    EnterCodeController *vc = [[EnterCodeController alloc]init];
//    vc.captchaCodeType = CaptchaCodeTypeChangePhone;
//    vc.phone = @"15819953377";
//    vc.countryAreaCode = [HealthHelper getCountryAreaCode];
//    [self.navigationController pushViewController:vc animated:true];
    
//    //上传失败
//    NotesGuideAlertView *notesGuideAlertView = [[NotesGuideAlertView alloc] init];
//    notesGuideAlertView.alertViewType = CenterAlertViewTypeRetestProject;
//    notesGuideAlertView.detectionItemName = @"";
//    notesGuideAlertView.modalPresentationStyle = UIModalPresentationOverCurrentContext;
//    notesGuideAlertView.confirmBlock = ^{
//    };
//    notesGuideAlertView.cancelBlock = ^{
//    };
//    self.modalPresentationStyle = UIModalPresentationCurrentContext;
//    [self.navigationController presentViewController:notesGuideAlertView animated:NO completion:nil];
    
    //检测页面
//    DetectionItemViewController *vc = [[DetectionItemViewController alloc]init];
//    vc.detectionItemType = DetectionItemTypeGout;
//    vc.period = @"Fasting";
//    vc.patientModel = HealthHelper.shared.homePatientList[0];
//    [self.navigationController pushViewController:vc animated:true];
    
//    MJMultipleModel *multipleModel = [[MJMultipleModel alloc]init];
//    multipleModel.patientId = @"1567396802553057280";
//    MJMultipleDetectionResultVC *vc = [[MJMultipleDetectionResultVC alloc]initWithModel:multipleModel];
//    [self.navigationController pushViewController:vc animated:true];
    
#pragma mark - 4合1检测明细
//    MJMultipleModel *model = [WCBDHelper.shared mj_getMultipleArrayWithParm:[self getParmModel]][0];
//    MJMultipleDetectionResultVC *vc = [[MJMultipleDetectionResultVC alloc]initWithModel:model];
//    vc.isFromDetection = true;
//    [self.navigationController pushViewController:vc animated:true];
#pragma mark - 总胆固醇检测明细
//    MJTotalCholesterolModel *model = [WCBDHelper.shared mj_getTotalCholesterolArrayWithParm:[self getParmModel]][0];
//    MJTotalDetectionResultVC *vc = [[MJTotalDetectionResultVC alloc]initWithModel:model];
//    [self.navigationController pushViewController:vc animated:true];
#pragma mark - 血红蛋白检测明细
//    MJHemoglobinModel *model = [WCBDHelper.shared mj_getHemoglobinArrayWithParm:[self getParmModel]][0];
//    MJHemoglobinDetectionResultVC *vc = [[MJHemoglobinDetectionResultVC alloc]initWithModel:model];
//    [self.navigationController pushViewController:vc animated:true];
#pragma mark - 血糖检测明细
//    MJBloodSugarModel *model = [WCBDHelper.shared mj_getBloodSugarArrayWithParm:[self getParmModel]][0];
//    MJBloodSugarDetectionResultVC *vc = [[MJBloodSugarDetectionResultVC alloc]initWithModel:model];
//    [self.navigationController pushViewController:vc animated:true];
#pragma mark - 尿酸检测明细
//    MJGoutDetectionModel *model = [WCBDHelper.shared mj_getGoutArrayWithParm:[self getParmModel]][0];
//    MJGoutDetectionResultVC *vc = [[MJGoutDetectionResultVC alloc]initWithModel:model];
//    vc.isFromDetection = true;
//    [self.navigationController pushViewController:vc animated:true];
    
#pragma mark - 修改邮箱 ChangEmailNumberVC ChangeEmailVC
//     [self pushViewController:@"ChangEmailNumberVC"];
#pragma mark - 修改密码
//     [self pushViewController:@"ChangPasswordVC"];
#pragma mark - 账户验证
//     [self pushViewController:@"AccountVerificationVC"];
#pragma mark - 账户安全
//     [self pushViewController:@"AccountSecurityVC"];
#pragma mark - 个人资料
//     [self pushViewController:@"PersonalInfoController"];
#pragma mark - 添加成员
//     [self pushViewController:@"AddMemberVC"];
#pragma mark - 语言
//    [self pushViewController:@"LanguageController"];
#pragma mark - 手机号码 ChangPhoneNumberVC PhoneNumberVC
//    [self pushViewController:@"ChangPhoneNumberVC"];
#pragma mark - 个人信息 我的
//    [self pushViewController:@"MyProfileController"];
#pragma mark - 4合1检查详情
//    [self MultipleDetection];
#pragma mark - 成员管理
//    [self pushViewController:@"MembersManageVC"];
#pragma mark - 检测记录
    
//    MemberDetectionRecordVC *vc = [[MemberDetectionRecordVC alloc]init];
//    vc.index = 3;
//    [self.navigationController pushViewController:vc animated:true];
    
//    [self pushViewController:@"MJCategoryRecordVC"];
#pragma mark - 手机号码
//    [self pushViewController:@"DetectionItemViewController"];
#pragma mark - 手机号码
//    [self pushViewController:@"MemberInfoVC"];
#pragma mark - 关于我们
//    [self pushViewController:@"AboutController"];
#pragma mark - 设置
//    [self pushViewController:@"SettingController"];
#pragma mark - 登录
//    [self pushViewController:@"HomeController"];
#pragma mark - 手机区号
//    [self pushViewController:@"CountryCodeVC"];

#pragma mark - 7天体验服务启动
//    [self mmmmmmWeek];
#pragma mark - 个人信息
//    [self pushViewController:@"WPMyInfomationViewController"];
#pragma mark - 知肾功
//    [self show12123344444];
#pragma mark - UIStackView 添加自适应高度view
//    [self xxsss];
//    [self pushViewController:@"StackViewVC"];
#pragma mark - 机构食药记录
//    [self xsdvsdvsxewewer];
#pragma mark - 选择受检人(药物添加)
//    [self xxewewer];
#pragma mark - 尿酸检测结果   1725414138982830080
//    [self show6666dsfadsf:@"1780830723717074944"];
#pragma mark - 选择受检人
//    [self show112224444555];
#pragma mark - 档案管理
//    [self pushViewController:@"MJArchivesManageVC"];
#pragma mark - 痛风服务（图表）
//    [self jumpTendencyChart];
#pragma mark - 辅助功能
//    [self pushViewController:@"HelpFunctionVC"];
#pragma mark - 主题设置
//    [self pushViewController:@"ThemeVC"];
#pragma mark - 二维码扫描添加受检人
//    [self pushViewController:@"ScanAddPatientVC"];
#pragma mark - 二维码扫描
//    [self pushViewController:@"TBScanVC"];
#pragma mark - 未关注公众号弹窗
//    [self mmmmmm8888];
#pragma mark - 未关注公众号弹窗
//    [self mmmmmm555];
#pragma mark - 建议同步肾功能评估弹窗
//    [self mmmmmm4444444];
//    [self playSound];
#pragma mark - 检测档案
//    [self show999];
#pragma mark - 服务次卡创建
//    ServiceCardAddVC *vc = [[ServiceCardAddVC alloc]init];
//    vc.patientId = @"1567396802553057280";
//    [self.navigationController pushViewController:vc animated:true];
#pragma mark - 服务次卡修改
//    ServiceCardDetailVC *vc = [[ServiceCardDetailVC alloc]init];
//    vc.model = [ServiceCardModel new];
//    [self.navigationController pushViewController:vc animated:true];
#pragma mark - 服务次卡
//    ServiceSubCardVC *vc = [[ServiceSubCardVC alloc]init];
//    vc.patientId = @"1567396802553057280";
//    vc.patientName = @"龙马";
//    [self.navigationController pushViewController:vc animated:true];
#pragma mark - 服务记录
//    [self pushViewController:@"MJCategoryRecordVC"];
#pragma mark - 糖尿病分期旧记录列表
//    [self pushViewController:@"MJBloodSugarRecordVC1"];


}

- (void)MultipleDetection{
    MJWeakSelf
    [MJHttpNetWorking requestWithParams:@{} requestUri:MultipleDetection_select requestType:RequestTypeGet showLoading:!self.hideLoading success:^(MJBaseModel *model) {
        
        if (model.code ==  200){
            NSArray *modelArray =  [NSArray yy_modelArrayWithClass:[MJMultipleModel class] json:model.data];
            MJMultipleModel *model = modelArray[0];
            MJMultipleDetectionResultVC *vc = [[MJMultipleDetectionResultVC alloc]initWithModel:model];
            [weakSelf.navigationController pushViewController:vc animated:true];
        }
    } failure:^(NSError *error) {
        
    }];
}

- (void)jumpMemberSelectAlertView{
    
//    age = 45;
//    bloodUnit = "mg/dL";
//    bloodUricAcid = "5.17";
//    createDateTime = "2024-08-14 16:42:17";
//    detectionId = 1823641280209477632;
//    gender = Female;
//    patientId = 1815216790974681088;
//    patientName = "可能";
//    period = Fasting;
//    risk = Minimal;
//    userId = 1812768669459972096;
    NSDictionary *data = @{
        @"bloodUnit":@"mg/dL",
        @"bloodUricAcid":@"5.17",
        @"createDateTime":@"2024-08-14 16:42:17",
        @"detectionId":@"1823641280209477632",
        @"gender":@"Female",
        @"patientId":@"1815216790974681088",
        @"patientName":@"可能",
        @"period":@"Fasting",
        @"risk":@"Minimal",
        @"userId":@"1812768669459972096",
    };
    MJBaseModel *model = [[MJBaseModel alloc]init];
    model.data = data;
    
    DetectionItemViewController *vc = [[DetectionItemViewController alloc]initWithModel:model itemType:DetectionItemTypeGout];
    vc.detectionItemType = DetectionItemTypeMultiple;
    vc.period = @"Fasting";
    vc.patientId = @"1815216790974681088";
    [self.navigationController pushViewController:vc animated:true];
  
}

@end
